data2$check[data2$q9=="Interview with a political activist" & data2$q10=="Sky News" & data2$tr_interview==0 & data2$tr_platform==0]  <-0
data2$check[data2$q9=="Weather report" & data2$q10=="YouTube Channel" & data2$tr_interview==0 & data2$tr_platform==0]  <-1
data2$check[data2$q9=="Weather report" & data2$q10=="YouTube Channel" & data2$tr_interview==0 & data2$tr_platform==1]  <-0
data2$check[data2$q9=="Weather report" & data2$q10=="YouTube Channel" & data2$tr_interview==1 & data2$tr_platform==0]  <-0
data2$check[data2$q9=="Weather report" & data2$q10=="YouTube Channel" & data2$tr_interview==1 & data2$tr_platform==1]  <-0
data2$check[data2$q9=="Weather report" & data2$q10=="Sky News" & data2$tr_interview==0 & data2$tr_platform==0]  <-0
data2$check[data2$q9=="Weather report" & data2$q10=="Sky News" & data2$tr_interview==1 & data2$tr_platform==0]  <-0
data2$check[data2$q9=="Weather report" & data2$q10=="Sky News" & data2$tr_interview==0 & data2$tr_platform==1]  <-1
data2$check[data2$q9=="Weather report" & data2$q10=="Sky News" & data2$tr_interview==1 & data2$tr_platform==1]  <-0
data2$check[data2$q9=="Sports programme"] <-0
data2$check[data2$q9=="Interview with a musician"] <-0
data2$check[data2$q10=="ABC Channel"] <-0
data2$check[data2$q10=="Channel 7"] <-0
data2$attention<-as.numeric(data2$q_att)
data2$attention[data2$q_att=="Strongly Disagree"]<-1
data2$attention[data2$q_att=="Neither Agree nor Disagree"]<-0
data2$attention[data2$q_att=="Somewhat Agree"]<-0
data2$attention[data2$q_att=="Somewhat Disagree"]<-0
data2$attention[data2$q_att=="Strongly Agree"]<-0
data2$attitudes_scale=(data2$attitudes_1+data2$attitudes_2+data2$attitudes_3+data2$attitudes_4)/40
data2$attitudes_pre_scale=(data2$attitudes_pre_1+data2$attitudes_pre_2+data2$attitudes_pre_3+data2$attitudes_pre_4+data2$attitudes_pre_5+data2$attitudes_pre_6)/30
data2$norms_scale=((data2$norms_1+data2$norms_2+data2$norms_3+data2$norms_4)/4)/100
data2$mis_attitudes[is.na(data2$attitudes_scale)]<-1
data2$mis_attitudes[!is.na(data2$attitudes_scale)]<-0
data2$mis_norms[is.na(data2$norms_scale)]<-1
data2$mis_norms[!is.na(data2$norms_scale)]<-0
data2$mis_actor<-0
data2$mis_actor[data2$q5==""]<-1
data2$mis_actor[data2$q5=="Don't know"]<-1
data2$wave <-2
mydata2 = select(data2, region, sex, age, education, ge19, party, age_num, Cottrell_opinion, Cottrell_respectable, Cottrell_unrespectable, Cottrell_dontknow, Cottrell3cat, tr_interview, tr_platform, tr, treatment, attitudes_pre_scale, attitudes_scale, norms_scale, mis_attitudes, mis_norms, mis_actor, attitudes_1,attitudes_2, attitudes_3, attitudes_4, norms_1, norms_2, norms_3, norms_4,
wave)
write.csv(mydata2,'data_2022.csv')
data_2022<-read.csv("data_2022.csv")
data_2020<-read.csv("data_2020.csv")
#Merge the two waves of the Australian study
common <- intersect(colnames(data_2020), colnames(data_2022))
data_combined <- rbind(data_2020[common], data_2022[common])
data_combined$norms_scale<-data_combined$norms_scale/100
names(data_combined)
table(data_combined$wave)
## Read in and recode the UK data
options(scipen=99)
uk<-read_excel("Survation_UK.xlsx")
uk$party[uk$ge2019=="Conservative"]<-1
uk$party[uk$ge2019=="Labour"]<-2
uk$party[uk$ge2019=="Brexit"]<-3
uk$party[uk$ge2019=="Green"]<-4
uk$party[uk$ge2019=="Liberal Democrats"]<-5
uk$party[uk$ge2019=="Scottish National Party"]<-6
uk$party[uk$ge2019=="Other"]<-7
uk$party[uk$ge2019=="Did not vote"]<-7
uk$brexit[uk$eu2016=="Remain"]<-1
uk$brexit[uk$eu2016=="Leave"]<-2
uk$brexit[uk$eu2016=="Did not vote"]<-3
uk$age_num<-as.numeric(uk$age)
uk$age_num[uk$age=="85+"]<-85
uk$mainstreamSN[uk$q3.1=="5 - Very mainstream"]<-5
uk$mainstreamSN[uk$q3.1=="4"]<-4
uk$mainstreamSN[uk$q3.1=="3"]<-3
uk$mainstreamSN[uk$q3.1=="2"]<-2
uk$mainstreamSN[uk$q3.1=="1 - Not mainstream at all"]<-1
uk$mainstreamYT[uk$q3.4=="5 - Very mainstream"]<-5
uk$mainstreamYT[uk$q3.4=="4"]<-4
uk$mainstreamYT[uk$q3.4=="3"]<-3
uk$mainstreamYT[uk$q3.4=="2"]<-2
uk$mainstreamYT[uk$q3.4=="1 - Not mainstream at all"]<-1
uk$mainstreamBBC[uk$q3.2=="5 - Very mainstream"]<-5
uk$mainstreamBBC[uk$q3.2=="4"]<-4
uk$mainstreamBBC[uk$q3.2=="3"]<-3
uk$mainstreamBBC[uk$q3.2=="2"]<-2
uk$mainstreamBBC[uk$q3.2=="1 - Not mainstream at all"]<-1
uk$mainstreamITV[uk$q3.3=="5 - Very mainstream"]<-5
uk$mainstreamITV[uk$q3.3=="4"]<-4
uk$mainstreamITV[uk$q3.3=="3"]<-3
uk$mainstreamITV[uk$q3.3=="2"]<-2
uk$mainstreamITV[uk$q3.3=="1 - Not mainstream at all"]<-1
uk$trustworthySN[uk$q4.1=="5 - Very trustworthy"]<-5
uk$trustworthySN[uk$q4.1=="4"]<-4
uk$trustworthySN[uk$q4.1=="3"]<-3
uk$trustworthySN[uk$q4.1=="2"]<-2
uk$trustworthySN[uk$q4.1=="1 - Not trustworthy at all"]<-1
uk$trustworthyYT[uk$q4.4=="5 - Very trustworthy"]<-5
uk$trustworthyYT[uk$q4.4=="4"]<-4
uk$trustworthyYT[uk$q4.4=="3"]<-3
uk$trustworthyYT[uk$q4.4=="2"]<-2
uk$trustworthyYT[uk$q4.4=="1 - Not trustworthy at all"]<-1
uk$trustworthyBBC[uk$q4.2=="5 - Very trustworthy"]<-5
uk$trustworthyBBC[uk$q4.2=="4"]<-4
uk$trustworthyBBC[uk$q4.2=="3"]<-3
uk$trustworthyBBC[uk$q4.2=="2"]<-2
uk$trustworthyBBC[uk$q4.2=="1 - Not trustworthy at all"]<-1
uk$trustworthyITV[uk$q4.3=="5 - Very trustworthy"]<-5
uk$trustworthyITV[uk$q4.3=="4"]<-4
uk$trustworthyITV[uk$q4.3=="3"]<-3
uk$trustworthyITV[uk$q4.3=="2"]<-2
uk$trustworthyITV[uk$q4.3=="1 - Not trustworthy at all"]<-1
uk$Robinson_dontknow[uk$q5=="Very respectable"]<-0
uk$Robinson_dontknow[uk$q5=="Quite respectable"]<-0
uk$Robinson_dontknow[uk$q5=="Don't know"]<-1
uk$Robinson_dontknow[uk$q5==""]<-1
uk$Robinson_dontknow[uk$q5=="Not that respectable"]<-0
uk$Robinson_dontknow[uk$q5=="Not at all respectable"]<-0
uk$Robinson_unrespectable[uk$q5=="Very respectable"]<-0
uk$Robinson_unrespectable[uk$q5=="Quite respectable"]<-0
uk$Robinson_unrespectable[uk$q5=="Don't know"]<-0
uk$Robinson_unrespectable[uk$q5==""]<-0
uk$Robinson_unrespectable[uk$q5=="Not that respectable"]<-1
uk$Robinson_unrespectable[uk$q5=="Not at all respectable"]<-1
uk$Robinson_respectable[uk$q5=="Very respectable"]<-1
uk$Robinson_respectable[uk$q5=="Quite respectable"]<-1
uk$Robinson_respectable[uk$q5=="Don't know"]<-0
uk$Robinson_respectable[uk$q5==""]<-0
uk$Robinson_respectable[uk$q5=="Not that respectable"]<-0
uk$Robinson_respectable[uk$q5=="Not at all respectable"]<-0
uk$Robinson3cat<-NA
uk$Robinson3cat[uk$q5=="Very respectable"]<-1
uk$Robinson3cat[uk$q5=="Quite respectable"]<-1
uk$Robinson3cat[uk$q5=="Don't know"]<-2
uk$Robinson3cat[uk$q5==""]<-2
uk$Robinson3cat[uk$q5=="Not that respectable"]<-0
uk$Robinson3cat[uk$q5=="Not at all respectable"]<-0
uk$tr_interview[uk$rand=="YT Interview Challenged"]<-1
uk$tr_interview[uk$rand=="Sky News Interview Challenged"]<-1
uk$tr_interview[uk$rand=="YT Interview Unchallenged"]<-1
uk$tr_interview[uk$rand=="Sky News Interview Unchallenged"]<-1
uk$tr_interview[uk$rand=="Sky News Weather"]<-0
uk$tr_interview[uk$rand=="YT Weather"]<-0
uk$tr_platform[uk$rand=="YT Interview Challenged"]<-0
uk$tr_platform[uk$rand=="Sky News Interview Challenged"]<-1
uk$tr_platform[uk$rand=="YT Interview Unchallenged"]<-0
uk$tr_platform[uk$rand=="Sky News Interview Unchallenged"]<-1
uk$tr_platform[uk$rand=="Sky News Weather"]<-1
uk$tr_platform[uk$rand=="YT Weather"]<-0
uk$tr_challenged[uk$rand=="YT Interview Challenged"]<-1
uk$tr_challenged[uk$rand=="Sky News Interview Challenged"]<-1
uk$tr_challenged[uk$rand=="YT Interview Unchallenged"]<-0
uk$tr_challenged[uk$rand=="Sky News Interview Unchallenged"]<-0
uk$tr_challenged[uk$rand=="Sky News Weather"]<-0
uk$tr_challenged[uk$rand=="YT Weather"]<-0
uk$tr[uk$rand=="YT Interview Challenged"]<-5
uk$tr[uk$rand=="Sky News Interview Challenged"]<-6
uk$tr[uk$rand=="YT Interview Unchallenged"]<-3
uk$tr[uk$rand=="Sky News Interview Unchallenged"]<-4
uk$tr[uk$rand=="Sky News Weather"]<-2
uk$tr[uk$rand=="YT Weather"]<-1
uk$challenge_bin[uk$rand=="YT Interview Challenged"]<-1
uk$challenge_bin[uk$rand=="Sky News Interview Challenged"]<-1
uk$challenge_bin[uk$rand=="YT Interview Unchallenged"]<-0
uk$challenge_bin[uk$rand=="Sky News Interview Unchallenged"]<-0
uk$challenge_bin[uk$rand=="Sky News Weather"]<-NA
uk$challenge_bin[uk$rand=="YT Weather"]<-NA
uk$tr_cat[uk$rand=="YT Interview Challenged"]<-3
uk$tr_cat[uk$rand=="Sky News Interview Challenged"]<-3
uk$tr_cat[uk$rand=="YT Interview Unchallenged"]<-2
uk$tr_cat[uk$rand=="Sky News Interview Unchallenged"]<-2
uk$tr_cat[uk$rand=="Sky News Weather"]<-1
uk$tr_cat[uk$rand=="YT Weather"]<-1
uk$treatment<-NA
uk$treatment[uk$rand=="YT Interview Challenged"]<- "Challenged YT Itw"
uk$treatment[uk$rand=="Sky News Interview Challenged"]<- "Challenged SN Itw"
uk$treatment[uk$rand=="YT Interview Unchallenged"]<- "Unchallenged YT Itw"
uk$treatment[uk$rand=="Sky News Interview Unchallenged"]<- "Unchallenged SN Itw"
uk$treatment[uk$rand=="Sky News Weather"]<- "SN Weather"
uk$treatment[uk$rand=="YT Weather"]<- "YT Weather"
uk$norms_1<-as.numeric(uk$q6.1)
uk$norms_2<-as.numeric(uk$q6.2)
uk$norms_3<-as.numeric(uk$q6.3)
uk$norms_4<-as.numeric(uk$q6.4)
uk$norms_5<-as.numeric(uk$q6.5)
uk$attitudes_1<-as.numeric(uk$q9.1)
uk$attitudes_1[uk$q9.1=="1 - totally disagree"]<-1
uk$attitudes_1[uk$q9.1=="10 - totally agree"]<-10
uk$attitudes_2<-as.numeric(uk$q9.2)
uk$attitudes_2[uk$q9.2=="1 - totally disagree"]<-1
uk$attitudes_2[uk$q9.2=="10 - totally agree"]<-10
uk$attitudes_3<-as.numeric(uk$q9.3)
uk$attitudes_3[uk$q9.3=="1 - totally disagree"]<-1
uk$attitudes_3[uk$q9.3=="10 - totally agree"]<-10
uk$attitudes_4<-as.numeric(uk$q9.4)
uk$attitudes_4[uk$q9.4=="1 - totally disagree"]<-1
uk$attitudes_4[uk$q9.4=="10 - totally agree"]<-10
uk$attitudes_5<-as.numeric(uk$q9.5)
uk$attitudes_5[uk$q9.5=="1 - totally disagree"]<-1
uk$attitudes_5[uk$q9.5=="10 - totally agree"]<-10
uk$attitudes_pre_1<-as.numeric(uk$q1.1)
uk$attitudes_pre_1[uk$q1.1=="7 - Strongly agree"]<-7
uk$attitudes_pre_1[uk$q1.1=="1 - Strongly disagree"]<-1
uk$attitudes_pre_1[uk$q1.1=="Don't know"]<-4
uk$attitudes_pre_2<-as.numeric(uk$q1.2)
uk$attitudes_pre_2[uk$q1.2=="7 - Strongly agree"]<-7
uk$attitudes_pre_2[uk$q1.2=="1 - Strongly disagree"]<-1
uk$attitudes_pre_2[uk$q1.2=="Don't know"]<-4
uk$attitudes_pre_3<-as.numeric(uk$q1.3)
uk$attitudes_pre_3[uk$q1.3=="7 - Strongly agree"]<-7
uk$attitudes_pre_3[uk$q1.3=="1 - Strongly disagree"]<-1
uk$attitudes_pre_3[uk$q1.3=="Don't know"]<-4
uk$attitudes_pre_4<-as.numeric(uk$q1.4)
uk$attitudes_pre_4[uk$q1.4=="7 - Strongly agree"]<-7
uk$attitudes_pre_4[uk$q1.4=="1 - Strongly disagree"]<-1
uk$attitudes_pre_4[uk$q1.4=="Don't know"]<-4
uk$attitudes_pre_5<-as.numeric(uk$q1.5)
uk$attitudes_pre_5[uk$q1.5=="7 - Strongly agree"]<-7
uk$attitudes_pre_5[uk$q1.5=="1 - Strongly disagree"]<-1
uk$attitudes_pre_5[uk$q1.5=="Don't know"]<-4
uk$attitudes_pre_6<-as.numeric(uk$q1.6)
uk$attitudes_pre_6[uk$q1.6=="7 - Strongly agree"]<-7
uk$attitudes_pre_6[uk$q1.6=="1 - Strongly disagree"]<-1
uk$attitudes_pre_6[uk$q1.6=="Don't know"]<-4
uk$radical_facts_1<-NA
uk$radical_facts_1<-as.numeric(uk$q7.1)
uk$radical_facts_1[uk$q7.1=="1 - fully inaccurate"]<-1
uk$radical_facts_1[uk$q7.1=="10 - fully accurate"]<-10
uk$radical_facts_2<-NA
uk$radical_facts_2<-as.numeric(uk$q7.2)
uk$radical_facts_2[uk$q7.2=="1 - fully inaccurate"]<-1
uk$radical_facts_2[uk$q7.2=="10 - fully accurate"]<-10
uk$attention<-as.numeric(uk$q3)
uk$attention[uk$q3=="Strongly disagree"]<-1
uk$attention[uk$q3=="Neither agree nor disagree"]<-0
uk$attention[uk$q3=="Somewhat agree"]<-0
uk$attention[uk$q3=="Somewhat disagree"]<-0
uk$attention[uk$q3=="Strongly agree"]<-0
uk$accuracy<-as.numeric(uk$q10)
uk$accuracy[uk$q10=="Interview with a far-right political activist"]<-1
uk$accuracy[uk$q10=="Interview with a political activist"]<-0
uk$accuracy[uk$q10=="Weather report"]<-0
uk$accuracy[uk$q10=="Interview with a musician"]<-0
uk$accuracy[uk$q10=="Sports programme"]<-0
uk$attitudes_scale=(uk$attitudes_1+uk$attitudes_2+uk$attitudes_3+uk$attitudes_4+uk$attitudes_5)/50
uk$attitudes_pre_scale=(uk$attitudes_pre_1+uk$attitudes_pre_2+uk$attitudes_pre_3+uk$attitudes_pre_4+uk$attitudes_pre_5+uk$attitudes_pre_6)/42
uk$norms_scale=((uk$norms_1+uk$norms_2+uk$norms_3+uk$norms_4 + uk$norms_5)/5)/100
uk$radical_facts=(uk$radical_facts_1+uk$radical_facts_2)/2
uk$mis_attitudes[is.na(uk$attitudes_scale)]<-1
uk$mis_attitudes[!is.na(uk$attitudes_scale)]<-0
uk$mis_norms[is.na(uk$norms_scale)]<-1
uk$mis_norms[!is.na(uk$norms_scale)]<-0
uk$mis_actor<-0
uk$mis_actor[uk$q5==""]<-1
uk$mis_actor[uk$q5=="Don't know"]<-1
uk$check<-uk$checking
uk$check[uk$check=="Media Match Content Partial-Match"]<-"Media Match Content Match"
uk$check[uk$check=="Media Mismatch Content Partial-Match"]<-"Media Mismatch Content Match"
uk$check_content<-uk$checking
uk$check_content[uk$check=="Media Match Content Match"]<-1
uk$check_content[uk$check=="Media Mismatch Content Match"]<-1
uk$check_content[uk$check=="Media Match Content Mismatch"]<-0
uk$check_content[uk$check=="Media Mismatch Content Mismatch"]<-0
uk$check_content<-as.numeric(uk$check_content)
uk$check_platform<-uk$checking
uk$check_platform[uk$check=="Media Match Content Match"]<-1
uk$check_platform[uk$check=="Media Mismatch Content Match"]<-0
uk$check_platform[uk$check=="Media Match Content Mismatch"]<-1
uk$check_platform[uk$check=="Media Mismatch Content Mismatch"]<-0
uk$check_platform<-as.numeric(uk$check_platform)
#Save datasets
save(data_combined, file = "data_combined.RData")
save(uk, file = "uk.RData")
save(data2, file = "data2.RData")
load("data_combined.RData")
load("uk.RData")
### Table 2
model1<-lm_robust(attitudes_scale~tr_interview+ tr_platform+wave, data=data_combined)
summary(model1)
model1_adj<-lm_robust(attitudes_scale~tr_interview+ tr_platform+wave+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party), data=data_combined)
summary(model1_adj)
model2<-lm_robust(attitudes_scale~tr_interview*tr_platform+wave, data=data_combined)
summary(model2)
model2_adj<-lm_robust(attitudes_scale~tr_interview*tr_platform+wave+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party), data=data_combined)
summary(model2_adj)
model3<-lm_robust(attitudes_scale~factor(tr_cat)+tr_platform, data=uk)
summary(model3)
model3_adj<-lm_robust(attitudes_scale~factor(tr_cat)+tr_platform+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party) + factor (brexit), data=uk)
summary(model3_adj)
model4<-lm_robust(attitudes_scale~factor(tr_cat)*tr_platform, data=uk)
summary(model3)
model4_adj<-lm_robust(attitudes_scale~factor(tr_cat)*tr_platform+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party) + factor (brexit), data=uk)
summary(model4_adj)
texreg(list(model1, model1_adj, model2, model2_adj,model3, model3_adj, model4, model4_adj), include.ci = FALSE, stars=c(0.001, 0.01, 0.05), caption="Anti-immigration attitudes")
## Table 3
model5<-lm_robust(norms_scale~tr_platform+tr_interview+wave, data=data_combined)
summary(model5)
model5_adj<-lm_robust(norms_scale~tr_platform+tr_interview+ wave+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party), data=data_combined)
summary(model5_adj)
model6<-lm_robust(norms_scale~tr_platform*tr_interview+wave, data=data_combined)
summary(model6)
model6_adj<-lm_robust(norms_scale~tr_platform*tr_interview+ wave+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party), data=data_combined)
summary(model6_adj)
model7<-lm_robust(norms_scale~factor(tr_cat)+tr_platform, data=uk)
summary(model7)
model7_adj<-lm_robust(norms_scale~factor(tr_cat)+tr_platform+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party) + factor (brexit), data=uk)
summary(model7_adj)
model8<-lm_robust(norms_scale~factor(tr_cat)*tr_platform, data=uk)
summary(model8)
model8_adj<-lm_robust(norms_scale~factor(tr_cat)*tr_platform+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party) + factor (brexit), data=uk)
summary(model8_adj)
texreg(list(model5, model5_adj, model6, model6_adj,model7, model7_adj, model8, model8_adj), include.ci = FALSE, stars=c(0.001, 0.01, 0.05), caption="Anti-Immigrant Norms")
###Table 4
model9<-lm_robust(radical_facts~factor(tr_cat) + tr_platform, data=uk)
summary(model9)
model9_adj<-lm_robust(radical_facts~factor(tr_cat) + tr_platform+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party) + factor (brexit), data=uk)
summary(model9_adj)
model10<-lm_robust(accuracy~factor(tr_cat) + tr_platform, data=uk)
summary(model10)
model10_adj<-lm_robust(accuracy~factor(tr_cat) + tr_platform+ factor(region) + factor(sex) + factor(education) + attitudes_pre_scale + age_num + factor(party) + factor (brexit), data=uk)
summary(model10_adj)
texreg(list(model9, model9_adj, model10, model10_adj ), include.ci = FALSE, stars=c(0.001, 0.01, 0.05), caption="Mechanisms")
load("data_combined.RData")
load("uk.RData")
##Figure 1
## Australia
data_combined$treatment[data_combined$tr_platform==0 & data_combined$tr_interview==0]<-"YT Weather"
data_combined$treatment[data_combined$tr_platform==1 & data_combined$tr_interview==0]<-"SN Weather"
data_combined$treatment[data_combined$tr_platform==1 & data_combined$tr_interview==1]<-"SN Interview"
data_combined$treatment[data_combined$tr_platform==0 & data_combined$tr_interview==1]<-"YT Interview"
data_combined$condition1<-factor(data_combined$treatment)
df1 <- data_combined %>%
group_by(condition1) %>%
mutate(condition1 = fct_relevel(condition1,
"YT Weather", "SN Weather", "YT Interview",
"SN Interview"))   %>%
summarise(
n=n(),
mean=mean(attitudes_scale, na.rm=TRUE),
sd=sd(attitudes_scale, na.rm=TRUE)
) %>%
mutate( se=sd/sqrt(n))  %>%
mutate( ic=se * qt((1-0.05)/2 + .5, n-1))
aus1 <- ggplot(df1) +
geom_bar(aes(x = condition1, y = mean), stat = "identity", fill = "grey", alpha = 0.5) +
geom_errorbar(aes(x = condition1, ymin = mean - ic, ymax = mean + ic), width = 0.15, colour = "black", alpha = 0.7, size = 1) +
geom_text(aes(x = condition1, y = mean, label = round(mean, 2)), vjust = -2.0, size = 3, color = "black") +  # Add means as text labels on top of the bars
scale_y_continuous(limits = c(0, 0.8)) +
ggtitle("Australia") +
theme(plot.title = element_text(hjust = 0.5)) +
theme_bw() +
labs(x = "", y = "Agree with ER statements")
##UK
uk$condition<-uk$treatment
uk$condition[uk$condition=="YT Weather"]<-"YT Weather"
uk$condition[uk$condition=="SN Weather"]<-"SN Weather"
uk$condition[uk$condition=="Unchallenged SN Itw"]<-"SN Int Unc"
uk$condition[uk$condition=="Challenged SN Itw"]<-"SN Int Chal"
uk$condition[uk$condition=="Unchallenged YT Itw"]<-"YT Int Unc"
uk$condition[uk$condition=="Challenged YT Itw"]<-"YT Int Chal"
uk$condition<-factor(uk$condition)
df2 <- uk %>%
group_by(condition) %>%
mutate(condition = fct_relevel(condition,
"YT Weather", "SN Weather", "YT Int Unc", "SN Int Unc", "YT Int Chal", "SN Int Chal" ))   %>%
summarise(
n=n(),
mean=mean(attitudes_scale),
sd=sd(attitudes_scale)
) %>%
mutate( se=sd/sqrt(n))  %>%
mutate( ic=se * qt((1-0.05)/2 + .5, n-1))
uk1 <- ggplot(df2) +
geom_bar( aes(x=condition, y=mean), stat="identity", fill="grey", alpha=0.5) +  scale_y_continuous(limits = c(0, .8))+
geom_errorbar( aes(x=condition, ymin=mean-ic, ymax=mean+ic), width=0.2, colour="black", alpha=0.8, size=1) +
geom_text(aes(x = condition, y = mean, label = round(mean, 2)), vjust = -3.0, size = 3, color = "black") +  # Add means as text labels on top of the bars
ggtitle("United Kingdom")  +
theme(plot.title = element_text(hjust = 0.5)) + theme_bw()+ labs(x="", y="Agree with ER statements")
##Combine figures
jpeg(file="attitudes.jpeg",  width = 800, height = 600)
p = list(aus1,uk1) %>% map(~.x + labs(y=NULL))
yleft = richtext_grob("Agree with Extreme Right statements", rot=90)
attitudes <- grid.arrange(grobs=p, ncol = 2, nrow = 1, left = yleft)
dev.off()
##Figure 2
df3 <- data_combined %>%
group_by(condition1) %>%
mutate(condition1 = fct_relevel(condition1,
"YT Weather", "SN Weather", "YT Interview",
"SN Interview"))   %>% summarise(
n=n(),
mean=mean(norms_scale, na.rm=TRUE),
sd=sd(norms_scale, na.rm=TRUE)
) %>%
mutate( se=sd/sqrt(n))  %>%
mutate( ic=se * qt((1-0.05)/2 + .5, n-1))
aus2 <- ggplot(df3) +
geom_bar( aes(x=condition1, y=mean), stat="identity", fill="grey", alpha=0.5) +  scale_y_continuous(limits = c(0, .8))+
geom_text(aes(x = condition1, y = mean, label = round(mean, 2)), vjust = -3.0, size = 3, color = "black") +  # Add means as text labels on top of the bars
geom_errorbar( aes(x=condition1, ymin=mean-ic, ymax=mean+ic), width=0.2, colour="black", alpha=0.7, size=1) +
ggtitle("Australia") + theme(plot.title = element_text(hjust = 0.5)) + theme_bw()+ labs(x="", y="Belief others agree with ER statements")
df4 <- uk %>%
group_by(condition) %>%
mutate(condition = fct_relevel(condition,
"YT Weather", "SN Weather", "YT Int Unc", "SN Int Unc", "YT Int Chal", "SN Int Chal" ))   %>%
summarise(
n=n(),
mean=mean(norms_scale, na.rm=TRUE),
sd=sd(norms_scale, na.rm=TRUE)
) %>%
mutate( se=sd/sqrt(n))  %>%
mutate( ic=se * qt((1-0.05)/2 + .5, n-1))
uk2 <- ggplot(df4) +
geom_bar( aes(x=condition, y=mean), stat="identity", fill="grey", alpha=0.5) +   scale_y_continuous(limits = c(0, .8))+
geom_errorbar( aes(x=condition, ymin=mean-ic, ymax=mean+ic), width=0.2, colour="black", alpha=0.8, size=1) +
geom_text(aes(x = condition, y = mean, label = round(mean, 2)), vjust = -3.0, size = 3, color = "black") +  # Add means as text labels on top of the bars
ggtitle("United Kingdom") + theme(plot.title = element_text(hjust = 0.5)) + theme_bw()+ labs(x="", y="Belief others agree with ER statements")
#Combine figures
jpeg(file="norms.jpeg",  width = 800, height = 600)
p1 = list(aus2,uk2) %>% map(~.x + labs(y=NULL))
yleft1 = richtext_grob("Believe others agree with Extreme Right statements", rot=90)
norms <- grid.arrange(grobs=p1, ncol = 2, nrow = 1, left = yleft1)
dev.off()
##Figure 3
# Australia
data_combined$treatment[data_combined$tr_platform==0 & data_combined$tr_interview==0]<-"1. YT Weather"
data_combined$treatment[data_combined$tr_platform==1 & data_combined$tr_interview==0]<-"2. SN Weather"
data_combined$treatment[data_combined$tr_platform==0 & data_combined$tr_interview==1]<-"3. YT Interview"
data_combined$treatment[data_combined$tr_platform==1 & data_combined$tr_interview==1]<-"4. SN Interview"
AUS_subset <- data_combined %>% select(treatment, Cottrell_respectable, Cottrell_unrespectable, Cottrell_dontknow)
AUS_subset$treatment<-factor(AUS_subset$treatment)
# Calculate means and CIs
AUS_long <- AUS_subset %>%
tidyr::gather(key = "outcome", value = "value",
Cottrell_respectable, Cottrell_unrespectable, Cottrell_dontknow) %>%
group_by(treatment, outcome) %>%
summarize(mean = mean(value),
lower_ci = mean - qt(0.975, df = n() - 1) * (sd(value) / sqrt(n())),
upper_ci = mean + qt(0.975, df = n() - 1) * (sd(value) / sqrt(n())))
# Create plot
fig_actor_AUS <- ggplot(AUS_long, aes(x = treatment, y = mean, fill = outcome)) +
geom_bar(stat = "identity", position = "dodge", color = "black") +
geom_errorbar(aes(ymin = lower_ci, ymax = upper_ci),
width = 0.2, position = position_dodge(0.9), color = "black") +
geom_text(aes(label = round(mean, 2)), vjust = -2.0, position = position_dodge(width = 0.9), size = 3) +
labs(x = "Experimental Condition", y = "Respectability of actor") +
scale_fill_manual(values = c("#2B2B2B", "#808080", "#D3D3D3"),
labels = c("don't know Cottrell", "Cottrell respectable", "Cottrell unrespectable")) +
theme_classic() +
scale_x_discrete(labels = c("YT Weather", "Sky Weather", "YT Interview", "Sky Interview"))
ggsave("fig_actor_AUS.pdf",
fig_actor_AUS,
width = 9,
height = 6)
# UK
uk$treatment<-uk$treatment
uk$treatment[uk$treatment=="YT Weather"]<-"1. YT Weather"
uk$treatment[uk$treatment=="SN Weather"]<-"2. SN Weather"
uk$treatment[uk$treatment=="Unchallenged YT Itw"]<-"3. YT Int Unc"
uk$treatment[uk$treatment=="Unchallenged SN Itw"]<-"4. SN Int Unc"
uk$treatment[uk$treatment=="Challenged YT Itw"]<-"5. YT Int Chal"
uk$treatment[uk$treatment=="Challenged SN Itw"]<-"6. SN Int Chal"
uk_subset <- uk %>% select(treatment, Robinson_respectable:Robinson_dontknow)
# Calculate means and CIs
uk_long <- uk_subset %>%
tidyr::gather(key = "outcome", value = "value",
Robinson_respectable:Robinson_dontknow) %>%
group_by(treatment, outcome) %>%
summarize(mean = mean(value),
lower_ci = mean - qt(0.975, df = n() - 1) * (sd(value) / sqrt(n())),
upper_ci = mean + qt(0.975, df = n() - 1) * (sd(value) / sqrt(n())))
# Create plot
fig_actor_UK <- ggplot(uk_long, aes(x = treatment, y = mean, fill = outcome)) +
geom_bar(stat = "identity", position = "dodge", color = "black") +
geom_errorbar(aes(ymin = lower_ci, ymax = upper_ci),
width = 0.2, position = position_dodge(0.9), color = "black") +
geom_text(aes(label = round(mean, 2)), vjust = -2.6, position = position_dodge(width = 0.9), size = 3) +
labs(x = "Experimental Condition", y = "Respectability of actor") +
scale_fill_manual(values = c("#2B2B2B", "#808080", "#D3D3D3"),
labels = c("don't know Robinson", "Robinson respectable", "Robinson unrespectable")) +
theme_classic() +
scale_x_discrete(labels = c("YT Weather", "Sky Weather", "YT Int Unch", "Sky Int Unch", "YT Int Chal", "Sky Int Chal"))
ggsave("fig_actor_UK.pdf",
fig_actor_UK,
width = 9,
height = 6)
#Figure 4
#Australia
interf<-subset(data_combined, select = (c(attitudes_scale, tr_interview, attitudes_pre_scale, norms_scale, tr_platform, wave, age)))
interf$Y1<-interf$attitudes_scale
interf$D<-interf$tr_interview
interf$X1<-interf$attitudes_pre_scale
interf$X2<-as.numeric(interf$age)
interf$Z1<-interf$tr_platform
interf$Z2<-interf$wave
interf1<-as.data.frame(interf)
#Moderator: libertarian-authoritarian attitudes
jpeg(file="attitudesinter2_AUS.jpeg",  width = 800, height = 600)
interflex(Y = "Y1", D = "D", X = "X1",  Z=c("Z1", "Z2"), estimator = 'binning', theme.bw = TRUE, data=interf1, xlab=("moderator = authoritarian attitudes"), ylab=("CATE of interview on attitudes"), na.rm = TRUE)
dev.off()
#Moderator: Age
jpeg(file="ageinter2_AUS.jpeg",  width = 800, height = 600)
interflex(Y = "Y1", D = "Z1", X = "X2",  Z=c("Z2"), estimator = 'binning', theme.bw = TRUE, data=interf1, xlab=("moderator = age in years"), ylab=("CATE of platform on attitudes"), na.rm = TRUE)
dev.off()
#UK
#Moderator: libertarian-authoritarian attitudes
interf2<-subset(uk, (tr_challenged!=1), select = (c(attitudes_scale, tr_interview, tr_challenged, attitudes_pre_scale, norms_scale, tr_platform, age_num, sex, education, party)))
interf2$Y1<-interf2$attitudes_scale
interf2$D<-interf2$tr_interview
interf2$X1<-interf2$attitudes_pre_scale
interf2$X2<-interf2$age_num
interf2$Z1<-interf2$tr_platform
interf_uk<-as.data.frame(interf2)
jpeg(file="attitudesinter2_GB.jpeg",  width = 800, height = 600)
interflex(Y = "Y1", D = "D", X = "X1",  Z=c("Z1"), estimator = 'binning', theme.bw = TRUE,data=interf_uk, xlab=("moderator = authoritarian attitudes"), ylab=("CATE of interview on attitudes"), na.rm = TRUE)
dev.off()
#Moderator: Age
interf3<-subset(uk, (tr==3 | tr==4), select = (c(attitudes_scale, tr_interview, attitudes_pre_scale, norms_scale, tr_platform, age_num, sex, education, party)))
interf3$Y1<-interf3$attitudes_scale
interf3$D<-interf3$tr_interview
interf3$X1<-interf3$attitudes_pre_scale
interf3$X2<-interf3$age_num
interf3$Z1<-interf3$tr_platform
interf_uk2<-as.data.frame(interf3)
jpeg(file="ageinter2_UK.jpeg",  width = 800, height = 600)
interflex(Y = "Y1", D = "Z1", X = "X2", estimator = 'binning', theme.bw = TRUE, data=interf_uk2, xlab=("moderator = age"), ylab=("CATE of platform type on attitudes"), na.rm = TRUE)
dev.off()
